package com.aitaoxue.palx.util;

import android.content.Context;
import android.content.DialogInterface;

import com.aitaoxue.palx.R;
import com.aitaoxue.palx.ui.dialog.CommonDialog;

public class UIHelper {

	public static void sendAppCrashReport(final Context context, final String crashReport) {
		CommonDialog dialog=new CommonDialog(context);
		
		dialog.setTitle(R.string.app_error);
		dialog.setMessage(R.string.app_error_message);
		dialog.setPositiveButton(R.string.submit_report,
				new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int which) {
						dialog.dismiss();
						// 发送异常报告
						TDevice.sendEmail(context, crashReport, "zhangdeyi@oschina.net");
						// 退出
						
					}
				});
		dialog.setNegativeButton(R.string.cancel,
				new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int which) {
						dialog.dismiss();
						// 退出
						
					}
				});
		dialog.show();
	}

}
